<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    console.log(1);
    setTimeout(()=>{
      console.log(2);
    },40);

    for(let i = 0;i<100000000;i++){}; // 这个for循环执行的事件肯定大于40ms了
    setTimeout(()=>{
      console.log(3);
    },10);
    console.log(4);
  </script>
</body>
</html>